package com.hitplane.manager 
{
	import flash.display.Sprite;
	import flash.display.Stage;

	/**
	 * 游戏容器管理
	 * 单例模式类
	 * @author rrDog
	 */
	public class GameContainManager
	{
		private static var _instance:GameContainManager = null;
		public function GameContainManager(single:Single) 
		{
			
			if(single == null)
			{
				throw new Error("Can't create instance , Single is Null!");
			}
		}
		/**
		 * 单例引用
		 */
		public static function get instance():GameContainManager
		{
			if(_instance == null)
			{
				_instance = new GameContainManager(new Single());
			}
			return _instance;
		}
		
		public function get mainStage():Stage { return _mainStage; }
		
		public function set mainStage(value:Stage):void 
		{
			_mainStage = value;
		}
		//start===============================================================
		public var gameBg:Sprite;
		public var gameContain:Sprite;
		public var panelContain:Sprite;
		
		private var _mainStage:Stage;
		
		public function setContain():void {
			if (_mainStage == null) throw new Error("必须先指定stage");
			gameBg = new Sprite();
			gameContain = new Sprite();
			panelContain = new Sprite();
			
			_mainStage.addChild(gameBg);
			_mainStage.addChild(gameContain);
			_mainStage.addChild(panelContain);
		}
	}
}
class Single{}